package com.newtype.meeting.client.model;

import java.io.Serializable;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.extjs.gxt.ui.client.data.BaseModel;

/**
 * 职称实体类
 * @author 汪恭泽
 * Jun 2, 2011 10:57:17 AM
 */
@SuppressWarnings("serial")
@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
public class Title extends BaseModel implements Serializable {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
	private String id;

	@Persistent
	private String titleCaption;
	@Persistent
	private Integer degree;

	public Title() {
	}

	public Title(String titleCaption, Integer degree) {
		super();
		this.titleCaption = titleCaption;
		this.degree = degree;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitleCaption() {
		return titleCaption;
	}

	public void setTitleCaption(String titleCaption) {
		this.titleCaption = titleCaption;
	}

	public Integer getDegree() {
		return degree;
	}

	public void setDegree(Integer degree) {
		this.degree = degree;
	}

	public void updateProperties() {
		set("titleCaption", getTitleCaption());
		set("degree", getDegree());
	}

	public void updateObject() {
		setTitleCaption((String) get("titleCaption"));
		setDegree((Integer) get("degree"));
	}
}
